<?php

/**
 * SettingsData form. ру
 *
 * @package    IPLIFE
 * @subpackage form
 * @author     alexey.shapran@gmail.com
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class SettingsDataForm extends BaseSettingsDataForm
{
	public function configure()
	{
		$this->setWidgets(array(
      'id'    => new sfWidgetFormInputHidden(),
      'title' => new sfWidgetFormInputText(),
      'body'  => new sfWidgetFormTextareaTinyMCE(array('width'  => 850,'height' => 350)),
	  '_csrf_token' => new sfWidgetFormInputHidden()
		));
		
	$this->setValidators(array(
      'id'    => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'title' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'body'  => new sfValidatorString(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('settings_data[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();    
	}
}
